package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 污染事件表
 * @TableName pollution_event
 */
@TableName(value ="pollution_event")
@Data
public class PollutionEvent implements Serializable {
    /**
     * 事件ID
     */
    @TableId(type = IdType.AUTO)
    private Long eventId;

    /**
     * 事件名称
     */
    private String eventName;

    /**
     * 事件类型：1-水污染，2-大气污染
     */
    private Integer eventType;

    /**
     * 污染源工厂ID
     */
    private Long sourceFactoryId;

    /**
     * 事件时间
     */
    private Date eventTime;

    /**
     * 事件位置
     */
    private String eventLocation;

    /**
     * 污染物类型
     */
    private String pollutantType;

    /**
     * 严重程度：1-轻微，2-中等，3-严重
     */
    private Integer severity;

    /**
     * 影响区域
     */
    private String affectedArea;

    /**
     * 处理状态：1-未处理，2-处理中，3-已处理
     */
    private Integer handleStatus;

    /**
     * 事件描述
     */
    private String description;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PollutionEvent other = (PollutionEvent) that;
        return (this.getEventId() == null ? other.getEventId() == null : this.getEventId().equals(other.getEventId()))
            && (this.getEventName() == null ? other.getEventName() == null : this.getEventName().equals(other.getEventName()))
            && (this.getEventType() == null ? other.getEventType() == null : this.getEventType().equals(other.getEventType()))
            && (this.getSourceFactoryId() == null ? other.getSourceFactoryId() == null : this.getSourceFactoryId().equals(other.getSourceFactoryId()))
            && (this.getEventTime() == null ? other.getEventTime() == null : this.getEventTime().equals(other.getEventTime()))
            && (this.getEventLocation() == null ? other.getEventLocation() == null : this.getEventLocation().equals(other.getEventLocation()))
            && (this.getPollutantType() == null ? other.getPollutantType() == null : this.getPollutantType().equals(other.getPollutantType()))
            && (this.getSeverity() == null ? other.getSeverity() == null : this.getSeverity().equals(other.getSeverity()))
            && (this.getAffectedArea() == null ? other.getAffectedArea() == null : this.getAffectedArea().equals(other.getAffectedArea()))
            && (this.getHandleStatus() == null ? other.getHandleStatus() == null : this.getHandleStatus().equals(other.getHandleStatus()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getEventId() == null) ? 0 : getEventId().hashCode());
        result = prime * result + ((getEventName() == null) ? 0 : getEventName().hashCode());
        result = prime * result + ((getEventType() == null) ? 0 : getEventType().hashCode());
        result = prime * result + ((getSourceFactoryId() == null) ? 0 : getSourceFactoryId().hashCode());
        result = prime * result + ((getEventTime() == null) ? 0 : getEventTime().hashCode());
        result = prime * result + ((getEventLocation() == null) ? 0 : getEventLocation().hashCode());
        result = prime * result + ((getPollutantType() == null) ? 0 : getPollutantType().hashCode());
        result = prime * result + ((getSeverity() == null) ? 0 : getSeverity().hashCode());
        result = prime * result + ((getAffectedArea() == null) ? 0 : getAffectedArea().hashCode());
        result = prime * result + ((getHandleStatus() == null) ? 0 : getHandleStatus().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", eventId=").append(eventId);
        sb.append(", eventName=").append(eventName);
        sb.append(", eventType=").append(eventType);
        sb.append(", sourceFactoryId=").append(sourceFactoryId);
        sb.append(", eventTime=").append(eventTime);
        sb.append(", eventLocation=").append(eventLocation);
        sb.append(", pollutantType=").append(pollutantType);
        sb.append(", severity=").append(severity);
        sb.append(", affectedArea=").append(affectedArea);
        sb.append(", handleStatus=").append(handleStatus);
        sb.append(", description=").append(description);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}